<?php
App::uses('AppController', 'Controller');
/**
 * Contratosdocs Controller
 *
 * @property Contratosdoc $Contratosdoc
 */
class ContratosdocsController extends AppController {

    public $layout = 'epcm';
    
    public function registra($idContrato = null)
    {
        if(!empty($this->request->data))
        {
            //debug($this->request->data);
            if($this->Contratosdoc->save($this->request->data))
            {
                echo 'guardo';   
            }
        }  
        
        $this->set(compact('idContrato'));  
    }     
    
    public function listado($idContrato = null)
    {
        $documentosC = $this->Contratosdoc->find('all', array(
            'recursive'=>-1,
            'conditions'=>array('contrato_id'=>$idContrato)            
        )); 
        $this->set(compact('documentosC'));
    }               
    
    //public function listado
}
